<template>
  <el-form
    :model="<%=model.name%>"
    <%-$parseAttrs(attrs)%>
  >
  <%_ model.keys.forEach(function(key){ _%>
    <%if(widgets[key]){_%>
      <el-form-item label="<%=widgets[key].label%>" prop="<%=key%>"
        <%if(rules[key]){_%> :rules="[<%-$formatRules(rules[key])%>]" <%}%>
      >
      <%# input:text -%>
      <%if(widgets[key].type === 'input:text'){%>
        <el-input v-model="<%=model.name%>.<%=key%>"
          <%-$parseAttrs(widgets[key].attrs)%>
        ></el-input>
      <%}%>

      <%# textarea -%>
      <%if(widgets[key].type === 'textarea'){%>
        <el-input v-model="<%=model.name%>.<%=key%>"
          type="textarea"
          <%-$parseAttrs(widgets[key].attrs)%>
        ></el-input>
      <%}%>
      </el-form-item>
    <%}%>
  <% }); %>
  </el-form>
</template>